/* cMap16Window.h
 * 16x16 tile editor window.
 */
#ifndef __newmoon_cmap16window_h
#define __newmoon_cmap16window_h

class Map16Window;
#include "cMainWindow.h"

class Map16Window: public Window {
	public:
		static const u32 BGColours[];
		
		Map16Window(MainWindow *Parent);
		~Map16Window();
		void Redraw();
	
	protected:
		MainWindow *Parent;
		DrawBox *TileBox;
		ImgBuf *TileBuf;
		bool ShowGrid;
		GtkLabel *StatusLabel;
		GtkWidget *ZoomBox, *PageBox, *BGColBox, *GridBox;
		u32 Zoom, Page, BGColIdx;
	
	private:
		friend class MainWindow;
		
		void _Create(MainWindow *Parent);
		friend void cMap16Window_TileBoxConfigureEvent(DrawBox* Box, GtkWidget* DrawingArea, GdkEventConfigure* Event, void *Win);
		friend void cMap16Window_TileBoxExposeEvent(DrawBox* Box, GtkWidget* DrawingArea, GdkEventExpose* Event, void *Win);
		friend void cMap16Window_TileBoxMouseMove(DrawBox* Box, GtkWidget* DrawingArea, GdkEventMotion* Event, u32 X, u32 Y, GdkModifierType State, void *Win);
		friend void cMap16Window_ZoomBoxChangeEvent(GtkComboBox *Box, gpointer Win);
		friend void cMap16Window_PageBoxChangeEvent(GtkComboBox *Box, gpointer Win);
		friend void cMap16Window_BGColBoxChangeEvent(GtkComboBox *Box, gpointer Win);
		friend void cMap16Window_GridBoxToggleEvent(GtkToggleButton *Box, gpointer Win);
		friend gboolean cMap16Window_DeleteEvent(GtkWidget *Widget, GdkEvent *Event, gpointer Win);
};
void cMap16Window_TileBoxConfigureEvent(DrawBox* Box, GtkWidget* DrawingArea, GdkEventConfigure* Event, void *Win);
void cMap16Window_TileBoxExposeEvent(DrawBox* Box, GtkWidget* DrawingArea, GdkEventExpose* Event, void *Win);
void cMap16Window_TileBoxMouseMove(DrawBox* Box, GtkWidget* DrawingArea, GdkEventMotion* Event, u32 X, u32 Y, GdkModifierType State, void *Win);
void cMap16Window_ZoomBoxChangeEvent(GtkComboBox *Box, gpointer Win);
void cMap16Window_PageBoxChangeEvent(GtkComboBox *Box, gpointer Win);
void cMap16Window_BGColBoxChangeEvent(GtkComboBox *Box, gpointer Win);
void cMap16Window_GridBoxToggleEvent(GtkToggleButton *Box, gpointer Win);
gboolean cMap16Window_DeleteEvent(GtkWidget *Widget, GdkEvent *Event, gpointer Win);

#endif //__newmoon_cmap16window_h
